services:
  adminer:
    container_name: 'boticord-adminer'
    depends_on:
      - postgres
    image: adminer
    restart: on-failure
    ports:
      - 8942:8080
  mysql:
    container_name: 'mysql'
    restart: on-failure
    env_file:
      - .env
    image: mysql
    volumes:
      - mysql:/var/lib/mysql
  migrator:
    container_name: 'migrator'
    restart: no
    depends_on:
      - postgres
      - mysql
    env_file:
      - .env
    image: boticord/migrator-service:latest
    build:
      context: .
      dockerfile: Dockerfile
      target: migrator
  postgres:
    container_name: 'boticord-postgres'
    image: postgres
    restart: on-failure
    environment:
      POSTGRES_PASSWORD: 123
      POSTGRES_USER: postgres
      POSTGRES_DB: boticord

volumes:
  mysql:
  postgres: